﻿//++
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Module Name:
//
//  MonitorEventArgs.cs
//    
// Abstract:
//
//  This module implements the MonitorItemDeletedEventArgs class.
//
//--

using System;
using System.Diagnostics;
using Microsoft.OfficeCommunicationsServer.Applications.Common;

namespace Microsoft.EnhancedReminders.Scheduler
{
    /// <summary>
    /// Event args used when a monitored item is deleted.
    /// </summary>
    internal class MonitorItemDeletedEventArgs : EventArgs
    {
        // Item deleted
        private readonly ItemIdType _itemId;

        // Task context
        private readonly TaskContext _taskContext;

        /// <summary>
        /// ctor.
        /// </summary>
        /// <param name="taskContext">Task context</param>
        /// <param name="itemId">Item deleted</param>
        internal MonitorItemDeletedEventArgs(TaskContext taskContext, ItemIdType itemId)
        {
            Debug.Assert(taskContext != null, "taskContext != null");
            Debug.Assert(taskContext.Context != null, "taskContext.Context != null");
            Debug.Assert(itemId != null, "itemId != null");

            _taskContext = taskContext;
            _itemId = itemId;
        }

        /// <summary>
        /// Returns the logging context.
        /// </summary>
        internal Context Context
        {
            get
            {
                return _taskContext.Context;
            }
        }

        /// <summary>
        /// Returns the task context.
        /// </summary>
        internal TaskContext TaskContext
        {
            get
            {
                return _taskContext;
            }
        }

        /// <summary>
        /// Returns the item that was deleted.
        /// </summary>
        internal ItemIdType ItemId
        {
            get
            {
                return _itemId;
            }
        }
    }
}
